import * as types from '../constants/ActionTypes';

export default function dosysmessage(state = [], action = {}) {
    const {
        type, payload
    } = action;

    switch (type) {
        case types.FETCH_SYS_MESSAGES:
            return { ...payload };
            
        case types.FETCH_SYS_MESSAGES_SUCCESS:
            return {
                message_sys_status : 1,
                message : "获取系统消息成功",
                results : [...payload.results]
            };
        case types.FETCH_SYS_MESSAGES_FAILURE:
            return {
                message_sys_status : -1,
                message : "获取系统消息失败",
                results : [...payload.results]
            };
        default:
            return state;
    }
}